package com.swak.bytes;

import com.swak.utils.Bits;

public class BitOps {

	public static void main(String[] args) {
		int num = Bits.setBit(0, 30, 1);
		num = Bits.setBit(num, 28, 1);
		num = Bits.setBit(num, 27, 1);
		System.out.println(num);
		System.out.println(Bits.getBit(num, 28));

		long init = 0;
		int index = 0, total = 0;
		for (int i = 0; i < 63; i++) {
			long n = Bits.setBit(init, index++, 1);
			total += n;
			System.out.println(i + ":" + n);
		}
		System.out.println(total);
	}
}
